package scaladay2

object WordCountDemo {
  def main(args: Array[String]): Unit = {
    val array = Array("you|jump", "i|jump")
    val arrays = array.map((line:String) => line.split("\\|"))
    val arrays2=arrays.flatten.map((x:String)=>(x,1))
    val temp = array.flatMap((line:String) => line.split("\\|"))
    println("3333" + temp.toBuffer)
    println(arrays.flatten.toBuffer)
    println(arrays2.toBuffer)
    val arrays3 = arrays2.groupBy(t=>t._1)
    println(arrays3.map(t=>t._1 + "=>" + t._2.length))
    //println(arrays2.toMap)

  }
}
